package com.smart.persistence.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;


@Entity
@Table(name = "T_Payment")
public class Payment {
	
	
	@Id
	@Column(name = "id_payment")
	@TableGenerator(name = "PAYMENT_GEN", allocationSize = 1, initialValue = 1, table = "T_ID", pkColumnName = "key", 
			valueColumnName = "valor", pkColumnValue = "ID_PAYMENT")
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "PAYMENT_GEN")
	private long id;
	
	//*/# INICIO - EXERC. 6
	@ManyToOne (fetch = FetchType.LAZY)
	@JoinColumn (name = "id_card")
	private Card card;
	
	public Card getCard() {
		return card;
	}
	
	public void setCard(Card card) {
		this.card = card;
	}
	
	//FIM - EXERC. 6 #*/


	@OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "id_book_hotel", nullable = false)    
	private BookHotel bookHotel;
	
	private BigDecimal total;
	
	@Embedded
	private BillingAddress adress;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}


	public BigDecimal getTotal() {
		return total;
	}

	public void setTotal(BigDecimal total) {
		this.total = total;
	}

	public BillingAddress getAdress() {
		return adress;
	}

	public void setAdress(BillingAddress adress) {
		this.adress = adress;
	}

	public BookHotel getBookHotel() {
		return bookHotel;
	}

	public void setBookHotel(BookHotel bookHotel) {
		this.bookHotel = bookHotel;
	}
	
    
    
	
	
}
